home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS03.ADF
/
AmigaBasicProgs
/
The Witching Hour
< prev
next >
Wrap
Text File
|
1986-04-02
|
7KB
|
230 lines
' The Witching Hour
' Translated from IBM basic to amigaBASIC
' by Paul J. Maloff
' You can play against the computor or have it make a move for you by
' pressing RETURN.
' But look-out it could GET you.
GOTO Programcontrol
Programcontrol:
CLEAR
GOSUB Initialize
GOTO Requestor
Twoo:
h=0 :K=0
FOR a=7 TO 35 : GOSUB Sixty : NEXT a
Threeo:
GOSUB Leave
IF h<0 THEN Quarterc
h=0 : K=0 : a=t : GOSUB Sixty
IF h<1 THEN Quarterc
GOTO Threeo
Initialize:
SCREEN 2,320,200,4,1 : COLOR 1,0 : CLS : WINDOW 2,"THE WITCHING HOUR",,,2
DIM Ghost(121),Witch(121),Square(98),d(28),x(35),y(35)
DIM l(35),xl(35),yl(35),n(28),b(42)
LINE (50,80)-(81,103),1,b
LOCATE 12,12:PRINT "The Witching Hour"
LINE (230,80)-(261,103),1,b
GET (50,80)-(81,103),Square
GOSUB Ghostbuilder
s=-1
FOR a=0 TO 7 : READ m(a) : NEXT a
FOR a=0 TO 28 : READ d(a) : NEXT a
b=48 : c=32 : d=59 :e=12
FOR a=0 TO 4
FOR f=0 TO 4
h=6*a+f+7 : x(h)=b*f+d-15 : y(h)=c*a+e-11 : l(h)=g+97 : n(g)=h
g=g+1 : xl(h)=6*f+10 : yl(h)=4*a+1
NEXT f
NEXT a
CLS
FOR a=0 TO 4
LINE(d,c*a+e)-(b*4+d,c*a+e),2 : LINE(b*a+d,e)-(b*a+d,c*4+e),2
NEXT a
a=0 : f=0
GOSUB Lne
a=b+b
GOSUB Lne
f=c+c
GOSUB Lne
a=0
GOSUB Lne
FOR a=0 TO 42 : READ b(a) : GOSUB Sevensixo : NEXT a
RETURN
Lne:
LINE (d+a,e+f)-(2*b+d+a,2*c+e+f),2 : LINE (d+a,2*c+e+f)-(2*b+d+a,e+f),2
RETURN
Sevensixo:
IF b(a)=2 THEN RETURN
IF b(a)<0 THEN PUT (x(a),y(a)),Witch,PSET
IF b(a)=0 THEN PUT (x(a),y(a)),Square,PSET
IF b(a)>0 THEN PUT (x(a),y(a)),Ghost,PSET
LOCATE yl(a),xl(a) : PRINT CHR$(l(a))
RETURN
Requestor:
d=0 : LOCATE 20,1
IF s=1 THEN PRINT "Ghost's Turn" ELSE PRINT "Witches Turn"
LOCATE 21,1
PRINT TAB (16) "From:";
Lp1:
e=e+1 : K$= INKEY$ : IF K$="" THEN Lp1
IF ASC(K$)=13 THEN GOSUB Blank : RANDOMIZE TIMER : GOTO Twoo
IF ASC (K$)<97 OR ASC (K$)>121 THEN Lp1
PRINT K$ : a=n(ASC(K$)-97) : z=a
Lp3:
LOCATE 23,18 : PRINT "To:";
Lp2:
K$=INKEY$ : IF K$="" THEN Lp2
IF ASC (K$)<97 OR ASC (K$)>121 THEN Lp2
PRINT K$; : t1=n(ASC(K$)-97)
ck=1 : l=0 : k1=0 : GOSUB Sixty : ck=0 : h=0 : a=7 : IF a=36 THEN Dodge
Dm2:
GOSUB Sixty : IF h>=1 THEN Dodge
a=a+1 : IF a<36 THEN Dm2
Dodge:
IF d THEN Fourseveno
IF l THEN Foureighto
Tone:
SOUND 99,5 : GOTO Requestor
Fourseveno:
IF l=0 OR k1=0 THEN SOUND 99,5 : GOTO fiveone
Foureighto:
IF k1=0 AND h>=1 THEN Tone
f=z : t=t1 : K=k1 : GOSUB Leave
IF k1=0 THEN Quarterc
a=t : z=a : h=0 : GOSUB Sixty
IF h<1 THEN Quarterc
fiveone:
GOSUB Blank : d=1 : GOTO Lp3
Leave:
b(t)=b(f) : b(f)=0 : a=f : GOSUB Sevensixo
IF K THEN b(K)=0 : a=K : GOSUB Sevensixo
a=t : GOTO Sevensixo
Leave2:
IF b(c+m(b)) THEN 160
sc=1+RND(1)*.9
IF h<sc THEN h=sc : f=a : t=c+m(b) : K=c
IF ck=0 THEN GOTO 160
IF t1=c+m(b) THEN l=1 : k1=c : b=7
RETURN
Quarterc:
s=-s : h=0 : a=7
Twosixo:
IF a=36 THEN Twoc
GOSUB Sixty
IF h=0 THEN a= a+1 : GOTO Twosixo
GOTO Requestor
Blank:
LOCATE 21,1 :PRINT SPACE$(30);
LOCATE 23,1 : PRINT SPACE$(30);
RETURN
Sixty:
IF b(a)=0 OR b(a)=-s OR b(a)=2 THEN RETURN
FOR b=0 TO d(a-7)
c=a+m(b)
IF b(c)=s OR b(c)=2 THEN 160
IF b(c) THEN Leave2:
sc=RND(1)*.9
IF h<sc THEN h=sc : f=a : t=c
IF ck=1 AND t1=c THEN l=1 : b=7
160 NEXT:RETURN
Twoc:
GOSUB Blank
LOCATE 20,1
IF s=1 THEN PRINT "The Witches Win"; :GOTO Startagain
PRINT "The Ghosts Win" : GOTO Startagain
Startagain:
LOCATE 23,1
PRINT "Do you wish to play again? Y/N";
Loop:
K$=INKEY$:IF K$="" THEN Loop
IF K$="y" OR K$="Y" THEN RUN
WINDOW CLOSE 2 : SCREEN CLOSE 2 : CLEAR : SYSTEM
Ghostbuilder:
PALETTE 14,.33,.13,0 : PALETTE 13,1,.81,.67 : PALETTE 15,.46,.46,.46
FOR y=82 TO 101
FOR x=58 TO 73
READ col : IF col=50 THEN Nextx
PRESET (x,y),col
Nextx:
NEXT x
NEXT y
GET (50,80)-(81,103),Witch
FOR y=82 TO 100
FOR x=232 TO 245
READ col : IF col=50 THEN Nextx1
PRESET (x,y),col
Nextx1:
NEXT x
NEXT y
GET (230,80)-(261,103),Ghost
RETURN
REM DATA FOR WITCH
210 DATA 50,50,02,50,50,50,50,50,50,50,50,50,50,50,50,50
201 DATA 50,02,02,02,50,50,50,50,50,50,50,50,50,50,50,50
230 DATA 50,02,02,02,02,02,50,50,50,50,50,50,50,50,50,50
240 DATA 02,50,02,02,02,02,02,02,02,02,50,50,50,50,50,50
250 DATA 50,50,02,02,14,14,14,14,14,50,02,02,02,50,50,50
260 DATA 50,02,50,13,13,13,14,14,14,14,50,50,50,50,50,50
270 DATA 02,50,13,50,13,13,02,02,14,14,50,50,50,50,50,50
280 DATA 50,50,50,50,13,50,02,02,02,02,02,02,50,50,50,50
290 DATA 50,50,50,13,50,50,02,02,15,02,02,02,02,50,50,50
300 DATA 50,50,13,13,02,02,02,02,15,02,02,02,02,50,50,50
310 DATA 50,50,13,13,02,02,02,02,15,02,02,02,02,50,50,50
301 DATA 50,50,50,50,02,02,02,02,15,02,02,02,50,50,50,50
330 DATA 50,50,50,50,50,15,15,15,02,02,02,02,50,50,50,50
340 DATA 50,50,50,50,50,02,02,15,02,02,15,02,50,50,50,50
350 DATA 50,50,50,50,50,02,02,15,02,02,15,02,02,50,50,50
360 DATA 50,50,50,50,50,15,15,15,15,15,15,02,02,02,50,50
370 DATA 50,50,50,50,50,50,15,15,15,15,15,15,15,15,50,50
380 DATA 50,50,50,50,50,50,15,15,15,15,15,15,15,15,15,50
390 DATA 50,50,50,50,50,50,14,14,50,15,15,15,15,15,15,15
400 DATA 50,50,50,50,50,14,14,14,50,50,14,14,14,50,50,50
410 REM DATA FOR GHOST
430 DATA 50,50,50,50,50,50,01,01,50,01,01,50,50,50
440 DATA 50,50,50,50,50,50,50,01,01,01,01,01,50,50
450 DATA 50,50,01,01,01,50,50,01,01,01,01,01,01,50
460 DATA 50,50,01,01,02,01,50,01,01,01,01,01,01,50
470 DATA 50,50,01,02,01,01,01,01,01,01,01,50,01,50
480 DATA 50,50,01,01,01,02,01,01,01,01,01,01,50,50
490 DATA 50,50,50,50,01,01,01,01,01,01,01,01,50,50
500 DATA 50,01,50,01,01,01,01,01,01,01,50,01,50,50
510 DATA 50,01,01,01,01,01,01,01,01,01,01,50,50,50
501 DATA 01,01,01,01,01,01,01,01,01,01,01,01,01,50
530 DATA 50,01,01,01,01,50,50,01,01,01,15,01,01,50
540 DATA 50,01,01,01,01,50,50,01,01,01,15,01,01,50
550 DATA 50,50,01,01,50,50,01,01,01,15,01,15,01,50
560 DATA 50,50,01,01,50,01,01,15,01,15,01,01,15,50
570 DATA 50,50,01,50,50,01,01,15,01,15,01,01,50,50
580 DATA 50,50,50,50,01,01,15,01,01,15,01,01,50,50
590 DATA 50,50,50,01,01,15,01,01,01,15,01,01,01,50
600 DATA 50,50,50,01,01,50,01,01,01,15,01,01,01,01
610 DATA 50,50,50,50,50,50,01,01,01,50,50,01,01,01
'control data
DATA -6,1,6,-1,-5,7,5,-7
DATA 7,3,7,3,7,0,3,7,3,7,3,0
DATA 7,3,7,3,7,0,3,7,3,7,3,0,7,3,7,3,7
DATA 2,2,2,2,2,2,2,-1,-1,-1,-1,-1,2
DATA -1,-1,-1,-1,-1,2,-1,-1,0,1,1,2
DATA 1,1,1,1,1,2,1,1,1,1,1,2,2,2,2,2,2,2